/**
 * Created by WYH on 17/1/8.
 */
var JudgeLogin = (function () {

    /* 判断是否登录 */
    function isLogin() {
        checkLoginExpire();
        if (window.localStorage.assign != "undefined" && window.localStorage.assign != undefined) {
            return true;
        } else {
            alert("您还未登录，请登录");
            // window.location.href = loginUrl;
            window.location.href = "/web-tribalc/html/login.html";
            return false;
        }
    }

    /* 点击退出登录 */
    function bindSignOutModule(module) {
        $(module).click(function () {
            window.localStorage.clear();
            window.location.href='../../html/login.html';
        });
    }


    function checkLoginExpire() {
        console.log(window.localStorage.expired);
    }


    return {
        isLogin: isLogin,
        bindSignOut: bindSignOutModule
    }

})();